import{d as E,a9 as x,b as v,o as p,a as b,k as B,c as D,w as i,e as _,f as c,t as m,u as t,j as d,q as R,bH as V,bK as S,F as T,g as N,bI as Z}from"./DrFvzlh8agutd.js";import{_ as q}from"./BfQegiIr3PfrX1.js";import{_ as $}from"./JLTbM6jQPQMM7.js";const j=["data-score"],H=E({__name:"app-input-password-meter",props:{value:{}},setup(o){const r=o,f=x(()=>a(r.value??""));function a(e){let s=0,l=0,g=0,C=0,n=0;const u=/[^A-Za-z0-9]/g,F=/(.*[a-z].*)/g,M=/(.*[A-Z].*)/g,U=/(.*[0-9].*)/g,z=/(\w)(\1+\1+\1+\1+)/g,A=u.test(e),h=F.test(e),w=M.test(e),y=U.test(e),k=z.test(e);return e.length>4&&((h||w)&&y&&(n=1),w&&h&&(C=1),(h||w||y)&&A&&(g=1),e.length>8&&(l=1),e.length>12&&!k&&(l=2),e.length>25&&!k&&(l=3),s=l+g+C+n,s>4&&(s=4)),s}return(e,s)=>(p(),v("div",null,[b("div",{class:"app-input-password-strength","data-score":f.value},null,8,j)]))}}),I={key:0,class:"message intro"},K={key:2,class:"message outro"},J=E({__name:"app-dialog-password-create",props:{done:{type:Function},title:{},intro:{},outro:{},requiresConfirm:{type:Boolean},allowEmpty:{type:Boolean}},setup(o){const r=o,f=x(()=>r.requiresConfirm??!0),a=B(""),e=B("");function s(){r.done?.(a.value)}function l(){r.done?.(void 0)}const g=x(()=>!!(r.allowEmpty&&a.value.length===0&&e.value.length===0||f.value&&a.value.length>0&&a.value===e.value));return(C,n)=>(p(),D(t(Z),{class:"tw-dialog app-dialog-password-create",active:"",standalone:"",close:!1,title:o.title??t(d)("dialog.password.titleCreate"),onClose:l},{footer:i(()=>[c(t(q),{onClick:l},{default:i(()=>[N(m(t(d)("dialog.password.buttonCancel")),1)]),_:1}),c(t(q),{disabled:!g.value,onClick:s},{default:i(()=>[N(m(t(d)("dialog.password.buttonContinue")),1)]),_:1},8,["disabled"])]),default:i(()=>[o.intro?(p(),v("p",I,m(o.intro),1)):_("",!0),c(t($),{title:t(d)("dialog.password.label1Create")},{default:i(()=>[R(b("input",{"onUpdate:modelValue":n[0]||(n[0]=u=>a.value=u),type:"password",class:"oui-input"},null,512),[[V,a.value],[t(S)]])]),_:1},8,["title"]),f.value?(p(),v(T,{key:1},[c(t($),{title:t(d)("dialog.password.label2Create")},{default:i(()=>[R(b("input",{"onUpdate:modelValue":n[1]||(n[1]=u=>e.value=u),type:"password",class:"oui-input"},null,512),[[V,e.value]])]),_:1},8,["title"]),c(t(H),{value:a.value},null,8,["value"])],64)):_("",!0),o.outro?(p(),v("p",K,m(o.outro??""),1)):_("",!0)]),_:1},8,["title"]))}});export{J as _};